﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace HelloXNA3.Components._3D.Polygon.Position
{
    class TwelvePolygonPosition
    {
        public static double Width1
        {
            get { return 1; }
        }

        public static double HelpX
        {
            get { return Width1 * Math.Sin(ConvertToRadians(18)); }
        }

        public static double HelpY
        {
            get { return Width1 * Math.Cos(ConvertToRadians(18)); }
        }

        public static double Width2
        {
            get { return Width1 + 2 * HelpX; }
        }

        public static double ZeroToPoint1
        {
            get { return 0.5 * Width1 / Math.Sin(ConvertToRadians(36)); }
        }

        public static double ZeroToPoint2
        {
            get { return 0.5 * Width2 / Math.Sin(ConvertToRadians(36)); }
        }

        public static double ZeroToEage1
        {
            get { return 0.5 * Width1 / Math.Tan(ConvertToRadians(36)); }
        }

        public static double ZeroToEage2
        {
            get { return 0.5 * Width2 / Math.Tan(ConvertToRadians(36)); }
        }

        public static double H1
        {
            get { return Math.Sqrt(Width1 * Width1 - (ZeroToPoint2 - ZeroToPoint1) * (ZeroToPoint2 - ZeroToPoint1)); }
        }

        public static double H2
        {
            get { return ((ZeroToPoint1 + ZeroToEage1 - HelpY) / HelpY) * H1; }
        }

        public const float scale = 1.5f;
        public static Vector3[] Corners = new Vector3[]
        {
              new Vector3( 0, (float)(H2/2 + H1) * scale, (float)ZeroToPoint1),
        };

        public static int[][] Faces = new int[][]
        {
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 4, 13, 5 },
            new int[]{ 1, 2, 7 ,6, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            new int[]{ 0, 1, 2 ,3, 4 },
            
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{0, 5, 12, 9, 4},
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },
            //new int[]{ 0, 1, 2 ,3, 4 },

             new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5, 12, 9, 4},
            new int[]{0, 5,12,9,4},
            new int[]{4,9,11,8,3},
            

           
            
        };

        public static double ConvertToRadians(double d)
        {
            return d * Math.PI / 180;
        }
    }
}
